
#include <iostream>
using namespace std;

struct A {
  int aa;
};

class B: public A{
  int bb;
};

class C: public A{
  int cc;
};

class D: public B,public C {
  int dd;
};

int main()
{
  A a;
  B b;
  C c;
  D d;
  cout<<"sizeof(A)\t"<<sizeof(a)<<endl; //4 int aa
  cout<<"sizeof(B)\t"<<sizeof(b)<<endl; //8 int aa,int bb
  cout<<"sizeof(C)\t"<<sizeof(c)<<endl; //8 int aa,int cc
  cout<<"sizeof(D)\t"<<sizeof(d)<<endl; //20int aa,int bb;int aa,int bb; int dd
}
